package shiyan6;

public class BreadTest {

    public static void main(String[] args) throws InterruptedException {
        YiXinZhiShop shop = new YiXinZhiShop();

        BreadProducer producerA = new BreadProducer("Producer-A", shop, 20);
        BreadProducer producerB = new BreadProducer("Producer-B", shop, 20);

        BreadConsumer consumerA = new BreadConsumer("Consumer-A", shop, 20);
        BreadConsumer consumerB = new BreadConsumer("Consumer-B", shop, 20);

        producerA.start();
        producerB.start();
        consumerA.start();
        consumerB.start();

        producerA.join();
        producerB.join();
        consumerA.join();
        consumerB.join();

        System.out.println("测试结束。");
    }
}
